Texo lang

The idea changes way too often

This is what I have for now:

What are contexts?

Contexts are required by some std lib functions denoted by ending with !

Functions using these must put the context needed in their type signature

Any other functions using a function needing some context must also provide the context

This bubbles up to the main function which provides all contexts

This verbosity is meant to discourage using unpure functions

Example:

Code:
(def greetings #{ :fr "Bonjour"
                  :en "Hello"   })

(def locale :en)

(def greet fn [] [(ask string) print] ()
  (print! "What's your name?")
  (let [name     (ask-string!)
        greeting (get locale greetings)]
    (print! `{{ greeting }}, {{ name }}`)))

(def main fn [] [(ask string) print] ()
  (greet))

Ouput:
< Florian
> Hello, Florian

More examples

random joke app in texo lang

XXIIVV webring